package net.tuandn.training.lesson.flexjson;

import java.util.ArrayList;
import java.util.List;

import net.tuandn.training.model.City;
import net.tuandn.training.model.Country;
import flexjson.JSONSerializer;

class DataManager {

	static Country getVietnamCountry() {
		City han = new City(1, "Hanoi", 6000);
		City haiphong = new City(2, "Haiphong", 4000);
		List<City> cities = new ArrayList<City>();
		cities.add(han);
		cities.add(haiphong);
		Country vietnam = new Country("vn", "Vietnam", "vi", 1945, han);
		vietnam.setCities(cities);
		return vietnam;
	}

	static String getJsonCities() {
		List<City> cities = new ArrayList<City>();
		cities.add(new City(1, "Hanoi", 6000));
		cities.add(new City(22, "London", 8000));
		cities.add(new City(93, "Tokyo", 12000));
		return new JSONSerializer().exclude("*.class", "special").serialize(cities);
	}
}
